package com.example.pdm_project_group_001;

//import android.R;
//import android.R.integer;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_menu);
		
		TextView tv1 = (TextView) findViewById(R.id.textView1);
		
//		tv1.setText(HttpConnect.updateBusHalts());
	
			Thread logoTimer = new Thread(){
			public void run(){
				try{
					int logoTimer = 0;
					while(logoTimer<2000)
					{
						sleep(100);
						logoTimer = logoTimer + 100;
					}
					startActivity(new Intent("com.example.pdm_project_group_001.MainMenu"));
					
				}
			
				catch(InterruptedException e)
				{
					e.printStackTrace();
				}
			
				finally{
					finish();
				}
			}
			
			
		};
		logoTimer.start();
//		
//		DBDataControl.loadDB(this);
//		
//		TextView tv = (TextView) findViewById(R.id.tv1);
//		DBDataControl dbh = new DBDataControl(this);
//		dbh.writeInfo("aaa");
//		
//		BusRouteFinder.findBus("1", "5");
//		BusRouteFinder.cursor.moveToFirst();
//		//tv.setText(BusRouteFinder.cursor.getCount() +"\n"+ BusRouteFinder.cursor.getString(2) );
//		tv.setText("");
//		BusRouteFinder.cursor.moveToFirst();
//		for(int i=0; i<BusRouteFinder.cursor.getCount(); i++){
//			tv.setText(tv.getText() + "\n" + BusRouteFinder.cursor.getString(0) + "\t" + BusRouteFinder.cursor.getString(1) +"\t" + BusRouteFinder.cursor.getString(2) );
//			BusRouteFinder.cursor.moveToNext();
//		}

		
//		 Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
//	        emailIntent.setType("plain/text");  
//	       emailIntent.putExtra(Intent.EXTRA_EMAIL  , new String[]{"navin.deneth@gmail.com"});
//	       emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "++id/autoCompleteTextView2+");
//	       emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "body text"); 
//	       startActivity(emailIntent);
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	@Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
//hybtgb